﻿// -----------------------------------------------------------------------
// <copyright file="ShieldParticle.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

#region Using Statements
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace Particle3DEffect
{
    /// <summary>
    /// Custom particle system for creating a flame effect.
    /// </summary>
    public class EnergyShieldParticle : ParticleSystem
    {
        public EnergyShieldParticle(Game game, ContentManager content)
            : base(game, content)
        { }


        protected override void InitializeSettings(ParticleSettings settings)
        {
            settings.TextureName = @"Resources/Effects/LensFlare";

            settings.MaxParticles = 200;

            settings.Duration = TimeSpan.FromSeconds(0.3f);

            settings.DurationRandomness = 10;

            settings.MinHorizontalVelocity = 0;
            settings.MaxHorizontalVelocity = 15;

            settings.MinVerticalVelocity = -5;
            settings.MaxVerticalVelocity = 5;

            // Set gravity upside down, so the flames will 'fall' upward.
            settings.Gravity = new Vector3(0, 2, 0);

            settings.MinColor = new Color(0, 0, 0, 255);
            settings.MaxColor = new Color(50, 0, 0, 255);

            settings.MinStartSize = 1;
            settings.MaxStartSize = 2;

            settings.MinEndSize = 1;
            settings.MaxEndSize = 3;

            // Use additive blending.
            settings.BlendState = BlendState.AlphaBlend;
        }
    }
}

